-- if mods["deadlock-beltboxes-loaders"] then
--   local function krCreateStacks(_stackable_krastorio_items)
--     for i, items in pairs(_stackable_krastorio_items) do
--       for _, item_name in pairs(items) do
--         ---@diagnostic disable-next-line
--         deadlock.add_stack(item_name, nil, "deadlock-stacking-" .. i)
--       end
--     end
--   end

--   --Adding new 4 tier
--   local loader_tier_3 = krastorio.items.getItem("express-transport-belt-loader")
--     or krastorio.items.getItem("kr-express-loader")
--     or "express-transport-belt"
--   ---@diagnostic disable-next-line
--   deadlock.add_tier({
--     transport_belt = "kr-advanced-transport-belt",
--     colour = { r = 76, g = 232, b = 48, a = 250 },
--     underground_belt = "kr-advanced-underground-belt",
--     splitter = "kr-advanced-splitter",
--     technology = "kr-logistic-4",
--     order = "d",
--     loader_ingredients = {
--       { loader_tier_3.name, 1 },
--       { "kr-steel-gear-wheel", 20 },
--       { "kr-rare-metals", 5 },
--     },
--     beltbox_ingredients = {
--       { "express-transport-belt-beltbox", 1 },
--       { "kr-steel-gear-wheel", 20 },
--       { "kr-rare-metals", 5 },
--     },
--     beltbox_technology = "deadlock-stacking-4",
--   })
--   krastorio.technologies.addPrerequisite("deadlock-stacking-4", "deadlock-stacking-3")

--   --Adding new 5 tier
--   local loader_tier_4 = krastorio.items.getItem("kr-advanced-transport-belt-loader")
--     or krastorio.items.getItem("kr-advanced-loader")
--     or "advanced-transport-belt"
--   ---@diagnostic disable-next-line
--   deadlock.add_tier({
--     transport_belt = "kr-superior-transport-belt",
--     colour = { r = 151, g = 34, b = 191, a = 250 },
--     underground_belt = "kr-superior-underground-belt",
--     splitter = "kr-superior-splitter",
--     technology = "kr-logistic-5",
--     order = "e",
--     loader_ingredients = {
--       { loader_tier_4.name, 1 },
--       { "low-density-structure", 2 },
--       { "kr-imersium-gear-wheel", 20 },
--     },
--     beltbox_ingredients = {
--       { "kr-advanced-transport-belt-beltbox", 1 },
--       { "low-density-structure", 4 },
--       { "kr-imersium-gear-wheel", 10 },
--     },
--     beltbox_technology = "deadlock-stacking-5",
--   })
--   krastorio.technologies.addPrerequisite("deadlock-stacking-5", "deadlock-stacking-4")

--   --Loader next upgrades
--   local loader_tier_5 = krastorio.items.getItem("kr-superior-transport-belt-loader")
--     or krastorio.items.getItem("kr-superior-loader")
--     or "superior-transport-belt"
--   if data.raw["loader-1x1"][loader_tier_3.name] and data.raw["loader-1x1"][loader_tier_4.name] then
--     data.raw["loader-1x1"][loader_tier_3.name].next_upgrade = loader_tier_4.name
--   end
--   if data.raw["loader-1x1"][loader_tier_4.name] and data.raw["loader-1x1"][loader_tier_5.name] then
--     data.raw["loader-1x1"][loader_tier_4.name].next_upgrade = loader_tier_5.name
--   end
--   --Beltbox next upgrades
--   if data.raw.furnace["express-transport-belt-beltbox"] and data.raw.furnace["kr-advanced-transport-belt-beltbox"] then
--     data.raw.furnace["express-transport-belt-beltbox"].next_upgrade = "kr-advanced-transport-belt-beltbox"
--   end
--   if
--     data.raw.furnace["kr-advanced-transport-belt-beltbox"]
--     and data.raw.furnace["kr-superior-transport-belt-beltbox"]
--   then
--     data.raw.furnace["kr-advanced-transport-belt-beltbox"].next_upgrade = "kr-superior-transport-belt-beltbox"
--   end

--   krastorio.recipes.convertIngredient("express-transport-belt-loader", "iron-gear-wheel", "kr-steel-gear-wheel")

--   krastorio.recipes.removeIngredient("express-transport-belt-beltbox", "iron-plate")
--   krastorio.recipes.convertIngredient("express-transport-belt-beltbox", "iron-gear-wheel", "kr-steel-gear-wheel")

--   krCreateStacks({
--     [1] = { -- Tier 1
--       "kr-blank-tech-card",
--       "kr-automation-core",
--       "kr-coke",
--       "kr-iron-beam",
--       "kr-inserter-parts",
--     },
--     [2] = { -- Tier 2
--       "kr-biomass",
--       "kr-quartz",
--       "kr-silicon",
--       "kr-rare-metal-ore",
--       "kr-rare-metals",
--       "kr-lithium-sulfur-battery",
--       "kr-enriched-copper",
--       "kr-enriched-iron",
--       "kr-enriched-rare-metals",
--       "kr-fuel",
--       "kr-biofuel",
--       "kr-fertilizer",
--       "kr-pollution-filter",
--       "kr-used-pollution-filter",
--       "kr-first-aid-kit",
--       "kr-electronic-components",
--       "kr-lithium",
--     },
--     [3] = { -- Tier 3
--       "kr-tritium",
--       "deuterium-oxide",
--       "kr-dt-fuel-cell",
--       "kr-imersite",
--       "kr-imersite-powder",
--       "kr-imersite-crystal",
--       "imersite-glass",
--       "black-reinforced-plate",
--       "white-reinforced-plate",
--     },
--     [5] = { -- Tier 5
--       "kr-ai-core",
--       "kr-imersium-plate",
--       "kr-imersium-beam",
--       "kr-imersium-gear-wheel",
--       "kr-charged-matter-stabilizer",
--       "kr-matter-stabilizer",
--       "kr-energy-control-unit",
--       "kr-advanced-fuel",
--       "kr-empty-antimatter-fuel-cell",
--       "kr-charged-antimatter-fuel-cell",
--     },
--   })

--   krCreateStacks({
--     [1] = { -- Tier 1
--       "kr-sand",
--       "kr-glass",
--     },
--     [2] = { -- Tier 2
--       "kr-steel-gear-wheel",
--       "kr-steel-beam",
--     },
--   })
-- end
